﻿@model IEnumerable<FCNS.ERP.Models.ErpUser>

@{
    ViewBag.Title = "用户";
    Layout = "~/Views/Shared/_Layout.cshtml";;
}

<h2>@ViewBag.Title</h2>

<p>
    <a class="newObjA" href="/Basic/UserNew">新增</a>
</p>
<table class="dataTable">
    <thead>
        <tr> 
            <th>
                @Html.DisplayNameFor(model => model.CategoryUserId)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.UserNO)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.IsPos)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.IsMan)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Tel)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.BookDinnerAuth)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.BookDinnerAdmin)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>

        @foreach (var item in Model)
        {
            <tr> 
                <td>
                    @Html.DisplayFor(modelItem => item.CategoryUser.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.UserNO)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.IsPos)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.IsMan)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Tel)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.BookDinnerAuth)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.BookDinnerAdmin)
                </td>
                <td>
                    @Html.ActionLink("编辑", "UserEdit", new { id = item.Id })
                    @if (item.CategoryUser.UserFlag == FCNS.ERP.Models.ErpCategoryUser.UserType.管理员)
                    { 
                        <a href="UserDelete/@item.Id" class="objDelete">删除</a>
                    }
                </td>
            </tr>
        }
    </tbody>

</table>
